Skip to content

Tests: Speed up unnecessary slow tests#22472

Open
LamentXU123 wants to merge 3 commits into
php:masterfrom
LamentXU123:speed-up-test
Open

Tests: Speed up unnecessary slow tests#22472
LamentXU123 wants to merge 3 commits into
php:masterfrom
LamentXU123:speed-up-test

Conversation

@LamentXU123

Copy link
Copy Markdown
Member
(38.649 s) Bug #81145 (copy() and stream_copy_to_stream() fail for +4GB files) [D:\a\php-src\php-src\ext\standard\tests\file\bug81145.phpt]
(36.937 s) mysqli_fetch_array() - large packages (to test compression) [D:\a\php-src\php-src\ext\mysqli\tests\mysqli_fetch_array_large.phpt]

de-facto we could just lower the ini setting to make it loop less.

@Girgias

Girgias commented Jun 26, 2026

Copy link
Copy Markdown
Member

Wouldn't it be better to make the openssl and mysqli test parallel, rather than faffing with tests that might need to be slow by necessity? (it might even be possible to just remove the conflict file for ext/openssl now that ephemeral ports are used)

@LamentXU123

LamentXU123 commented Jun 26, 2026

Copy link
Copy Markdown
Member Author

The second one is actually slow because the tested behavior is to break the program when memory isn't enough. We could just lower the memory amount to break it way earlier though. The first one is similar (it's testing max execution time. We don't need to wait for the default max execution time)

However, I do agree we can just remove the conflict file for ext/openssl now. Let's do it.

@LamentXU123 LamentXU123 marked this pull request as draft June 26, 2026 14:59
@LamentXU123 LamentXU123 marked this pull request as ready for review June 26, 2026 15:54
@LamentXU123 LamentXU123 changed the title Tests: Speed up unnecessary slow tests Tests: Allow OpenSSL and mysqli tests to run in parallel Jun 26, 2026
@LamentXU123

Copy link
Copy Markdown
Member Author
(33.675 s) mysqli_fetch_array() - large packages (to test compression) [D:\a\php-src\php-src\ext\mysqli\tests\mysqli_fetch_array_large.phpt]
(30.397 s) Bug #81145 (copy() and stream_copy_to_stream() fail for +4GB files) [D:\a\php-src\php-src\ext\standard\tests\file\bug81145.phpt]

It is faster for a couple of seconds for every OpenSSL and mysql tests as observed.

@Girgias

Girgias commented Jun 28, 2026

Copy link
Copy Markdown
Member

Probably makes sense to split the openssl test changes into its own PR.

@LamentXU123 LamentXU123 changed the title Tests: Allow OpenSSL and mysqli tests to run in parallel Tests: Allow OpenSSL tests to run in parallel Jun 28, 2026
@LamentXU123 LamentXU123 changed the title Tests: Allow OpenSSL tests to run in parallel Tests: Allow mysqli tests to run in parallel Jun 28, 2026
@LamentXU123

Copy link
Copy Markdown
Member Author

I split it. See #22499

@iluuu1994

Copy link
Copy Markdown
Member

See e1ec67a. This was a conscious decision, as these tests caused more failures with parallelization. We do have the retry mechanism now, I don't know if that's enough.

@LamentXU123

LamentXU123 commented Jul 4, 2026

Copy link
Copy Markdown
Member Author

@iluuu1994 I was aware. My point is to change the conflict key from all to mysql. Since ext/mysqli/tests/CONFLICTS and ext/pdo_mysql/tests/CONFLICTS both use mysql, these tests remain serialized with the MySQL test group and should still avoid shared MySQL server contention, and also allow unrelated tests to run in parallel.

wdyt? This is also the same in #22499

@iluuu1994

Copy link
Copy Markdown
Member

See https://github.com/php/php-src/blob/master/ext/mysqli/tests/CONFLICTS. This has no effect, the conflict key is already there. The CONFLICTS all was added after, because running it in parallel with other tests still caused failures. I don't remember the details, but could have been network overload.

…into speed-up-test

* 'speed-up-test' of https://github.com/LamentXU123/php-src:
  Tests: Allow mysqli tests to run in parallel
@LamentXU123

Copy link
Copy Markdown
Member Author

I see. I thought this is solved because we now use ephemeral ports.

Given the uncertainty of the result of this PR. I think we can just return to the original idea to lower the ini setting to avoid unnecessary waiting. I am closing #22499

@LamentXU123 LamentXU123 changed the title Tests: Allow mysqli tests to run in parallel Tests: Speed up unnecessary slow tests Jul 4, 2026
@iluuu1994

Copy link
Copy Markdown
Member

Ephemeral ports solve a different issue (different servers being spun up in parallel). There were different efforts to parallelize tests (avoid conflicting table names), but it looks like the CI change was never merged (i.e. removing the CONCLIFCTS file). Maybe @Girgias remembers why that is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants